<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
	</head>
	<body>
		<div id="app">
			<hobby-list :hobbies='hobbies' :person="p"></hobby-list>
		</div>
		
		<script>
			var app = Vue.createApp({
				data(){
					return {
						'hobbies': [
							"唱歌","跳舞","打球"
						],
						'p': {
							name: '扫货',
							age: 18
						}
					}
				}
			})
			
			app.component('hobby-list',{
				template: "{{person.name}}{{person.age}}<div v-for='h in hobbies'>{{h}}</div>",
				props: ['hobbies','person']
			})
			
			var vm = app.mount("#app")
		</script>
	</body>
</html>
